
#include "System/Memory.h"
#include "TutorialManager.h"
#include "game.h"
#include "GameObjectManager.h"

TutorialManager::TutorialManager()
{

	
}

void TutorialManager::SaveData(CWriteFile* stream)
{
	
}
void TutorialManager::LoadData(CReadFile* stream)
{
	
}

void TutorialManager::initialize()
{
	m_crtTuto = TUTO_NONE;
}

void TutorialManager::Update()
{
	if(m_crtTuto == TUTO_NONE)
		return;
	if(m_iDelay >0)
	{
		m_iDelay -= getGame()->GetGameplayTimeStep();
		return;
	}
}

void TutorialManager::Draw()
{
	
	if(m_crtTuto == TUTO_NONE)
		return;

	if(m_iDelay >0)
		return;
	getGfx()->SetColor(0x30ffffff);	
	getGfx()->FillRect(0,0,SCREEN_WIDTH,SCREEN_HEIGHT);
	getGfx()->SetColor(0xffff0000);	
	getGfx()->DrawCircle2(m_focusPosX,m_focusPosY,40 - m_iFocusStep * 3);

	m_iFocusStep++;
	if(m_iFocusStep == 5)
		m_iFocusStep = 0;
}

void TutorialManager::PlayTuto(int type)
{
	m_crtTuto = type;
	int R = 25;
	getTouchInput().AddRegion(Region("btnLock",SHAPE_RECT,0,0,SCREEN_WIDTH,SCREEN_HEIGHT));

	if(m_crtTuto == TUTO_1)
	{
		m_iDelay = 1;
		m_iFocusStep = 0;
		m_focusPosX = 700;
		m_focusPosY = 375;

		getGame()->SetTimeFrezze(true);
	}
}